<template>
  <div class="app">
    <div class="brand" v-for="item in topicList" :key="item.id">
      <img :src="item.scene_pic_url" width="100%" />
      <div class="item-des">
        <h4>{{item.title}}</h4>&emsp;
        <div class="shopinfo">
          <p class="subTitle">{{item.subtitle}}</p>
          <p class="price">{{item.price_info | priceFilter}}起</p>
        </div>
      </div>
    </div>
    <van-pagination
      v-model="currentPage"
      :page-count="2"
      @change="topage"
      class="page"
      mode="simple"
    />
  </div>
</template>

<script>
import { TopicList } from "@/request/api";

export default {
  props: {
    topicList: Array
  },
  data() {
    return {
      currentPage: this.topicList.totalPages
    };
  },
  methods: {
    topage(e) {
      TopicList({
        page: e,
        size: 10
      }).then(res => {
        //判断是否被拦截
        if (res.errno == "0") {
          this.list = res.data.data;
        }
      });
    }
  }
};
</script>

<style lang="less" scoped>
.brand {
  border-bottom: 10px solid #f4f4f4;
  height: 100%;
  .item-des {
    text-align: center;
    h4 {
      font-weight: normal;
      line-height: 40px;
      margin: 0;
    }
    .shopinfo {
      color: #666;
      .subTitle {
        color: #666;
        font-size: 12px;
        width: 80%;
        margin: auto;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
      }
      .price {
        margin: 0;
        color: darkred;
        height: 40px;
        line-height: 40px;
      }
    }
  }
}
.page {
  display: flex;
  justify-content: space-between;
  margin-bottom: 50px;
  border-bottom: 10px solid #f4f4f4;
  /deep/.van-pagination__page-desc {
    display: none;
  }
  /deep/.van-pagination__item {
    color: #323233;
    &:active {
      background-color: #f9f9f9;
    }
  }
}
</style>